<template>
  <div>
    <el-row>
     <el-col v-if="totalCount>0"> 共找到{{totalCount}}条记录，仅展示30条</el-col> 
    </el-row>
    <el-row>
        <el-col :span="8" v-for="user in userList" :key="user.id">
           <el-row  class="items">
             <el-col> <el-avatar :size="100" :src="user.avatar_url"></el-avatar></el-col>
             <el-col>{{user.login}}</el-col>
           </el-row>
        </el-col>   
    </el-row>
  </div>
</template>

<script>
export default {
   data() {
    return {
      totalCount:0,
      userList:[]
    }
   },
   mounted(){
    console.log(this.$eventBus); 
    this.$eventBus.$on('userList',(count,list)=>{
       this.totalCount=count
       this.userList=list
    })
   }
}
</script>

<style scoped>
.items {
    text-align: center;
}
</style>